Process.h
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
process.h is the C header file which contains function declarations and macros used in working with threads and processes. Most C compilers that target DOS, Windows 3.1x, Win32, OS/2, Novell NetWare or DOS extenders supply this header and the library functions in their C library. Neither the header file nor most of the functions are defined by either the ANSI/ISO C standard or by POSIX.
Contents
• History
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
History
Microsoft's version of the file dates back to at least 1985, according to its copyright statement.cite-ref-1[1] An early reference to the file was in a post on the net.micro.pc usenet on Oct-26-1986.cite-ref-msft-process-h-2-0[2] The compiler used was Microsoft C compiler version 3.0. The Lattice C compiler version 3.30 (Aug-24-1988) did not have such a header file, but offered similar functions. Borland provided the header in their Turbo C compiler version 2.01. The C Ware-Personal C compiler version 1.2c (June 1989) had only the ANSI headers.
Functions
| Name | Description | Notes |
|---|---|---|
| execl, execle, execlp, execlpe | load and execute a new child process by placing it in memory previously occupied by the parent process. Parameters are passed individually. | DOS, Win, OS/2, POSIX |
| execv, execve, execvp, execvpe | load and execute a new child process by placing it in memory previously occupied by the parent process. Parameters are passed as an array of pointers. | DOS, Win, OS/2, POSIX |
| spawnl, spawnle, spawnlp, spawnlpe | load and execute a new child process. Parameters are passed individually. | DOS, Win, OS/2 |
| spawnv, spawnve, spawnvp, spawnvpe | load and execute a new child process. Parameters are passed as an array of pointers. | DOS, Win, OS/2 |
| beginthread, beginthreadNT | creates a new thread of execution within the current process. | Win, OS/2 |
| endthread | terminates a thread created by beginthread . | Win, OS/2 |
| getpid | returns the process identifier . | DOS, Win, OS/2 |
| cexit | restore interrupt vectors altered by the startup code. | DOS, Win, OS/2 |
Constants
| Name | Description | Notes | OS |
|---|---|---|---|
| _P_WAIT | Suspends parent process until the child process has finished executing. | synchronous spawn. | MS-DOS, Win32, OS/2 |
| _P_NOWAIT, _P_NOWAITO | Continues to execute calling process concurrently with new process. | asynchronous spawn. | Win32, OS/2 |
| _P_OVERLAY | Overlays parent process with child, which destroys the parent. | has the same effect as the exec* functions. | MS-DOS, Win32, OS/2 |
| _P_DETACH | The child is run in background without access to the console or keyboard. | Calls to _cwait upon the new process will fail. Asynchronous spawn. | Win32, OS/2 |
| _WAIT_CHILD | used as cwait action. | Obsolete on Win32. | MS-DOS, OS/2 |
| _WAIT_GRANDCHILD | used as cwait action. | Obsolete on Win32. | MS-DOS, OS/2 |
Implementations
Given the fact there is no standard on which to base the implementation, the functions declared by process.h differ, depending on the compiler in use. Below is a list of compilers which provide process.h.
• MinGWcite-ref-9[9]
• Microsoft Visual C++cite-ref-10[10]
• Lcc32cite-ref-13[13]
• QNX Neutrino QCC 6.xcite-ref-14[14]
Differences
Another aspect that might vary is the combined length of exec* and spawn* parameters.
• Delorie DJGPP: does not have such a limit.cite-ref-djgpp-spawn-15-0[15]
• Digital Mars: the maximum is 128 bytes; nothing is stated about the ending '\0' character.
• Microsoft cl: the argument list for the new process must not exceed 1024 bytes.cite-ref-msdn-16-0[16]
References
cite-note-msft-process-h-22. ↑ Is my floppy diskette formated?, groups-beta.google.com
cite-note-33. ↑ Delorie.com
cite-note-djgpp-process-h-44. ↑ DJGPP process.h, delorie.com
cite-note-55. ↑ Openwatcom.org Archived 2015-03-17 at the Wayback Machine
cite-note-watcom-clib-66. ↑ OpenWatcom clib Archived 2006-10-11 at the Wayback Machine, openwatcom.org
cite-note-77. ↑ DigitalMars.com
cite-note-mars-process-h-88. ↑ Digital Mars process.h, digitalmars.com
cite-note-99. ↑ MinGW.org
cite-note-1010. ↑ "MSDN.Microsoft.com". Archived from the original on 2007-07-07. Retrieved 2007-01-15.
cite-note-1111. ↑ "Borland.com". Archived from the original on 2012-11-05. Retrieved 2007-01-15.
cite-note-turboc-2-0-1212. ↑ C version 2.01, dn.codegear.com
cite-note-1313. ↑ CS.Virginia.edu
cite-note-1414. ↑ QNX.com
cite-note-djgpp-spawn-1515. ↑ DJGPP spawn*, delorie.com
cite-note-msdn-1616. ↑ Microsoft MSDN, msdn.microsoft.com
External links